
<?php
defined('_JEXEC') or die("Invalid access");
jimport('joomla.application.component.model');
 
class SophiaModelHome extends JModel
{
 

var $_data;
	
	function _buildQuery()
	{
	    $user	 =& JFactory::getUser();
		
		$this->_query = ' SELECT * FROM #__sophia_estudiantes AS al WHERE user_id = '. $user->id;
        return $this->_query;	
	}


	
	function __construct()
	{
		parent::__construct();
    }

	function getData() 
	{
 	if (empty($this->_data)) {
							$query = $this->_buildQuery();
							$this->_data = $this->_getList($query);
						}
						return $this->_data;	
						
	}	

	function getList()
	{
		// state filter
		$lists['state']	= JHTML::_('grid.state',  $this->filter_state );

		// table ordering
		$lists['order_Dir']	= $this->filter_order_Dir;
		$lists['order']		= $this->filter_order;

		// search filter
		$lists['search']= $this->search;
		
		return $lists;
	}
}


	

?>